home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!uni-heidelberg!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb!feck
- From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
- Subject: Re: How to detach from cli.
- Message-ID: <1994Feb8.193709@informatik.uni-kl.de>
- Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
- Nntp-Posting-Host: uklirb.informatik.uni-kl.de
- Organization: University of Kaiserslautern, Germany
- References: <1994Feb8.110410.22728@dmu.ac.uk>
- Date: Tue, 8 Feb 1994 18:37:09 GMT
- Lines: 29
-
- In article <1994Feb8.110410.22728@dmu.ac.uk>, se1pt@dmu.ac.uk (Paul Toyne) writes:
- > Cli detaching from assembler is very easy, and goes like follows :
- >
- > Section Start,CODE
- >
- > _Start:
- > ; Check for WB startup, if so Jmp _Program
- >
- > ; Open dos library
- >
- > Lea _Start(pc),a0
- > Move.l (a0),d3 ; Pointer to segment list.
- > Clr.l (a0) ; Make dos think that this program
- > ; only contains one hunk, so that it
- > ; doesn't de-allocate the memory from
- > ; our program.
-
- This is VERY bad programming practise. You should not touch the
- segment list.
-
- The correct way to do detaching (whatever reason you might have
- to not use "run") is to NULL out the cli_Module pointer, and
- start a new process with this segment and with a different
- entry point (use CreateNewProc).
-
- An example can be found in the source code to `term'.
-
- 3k// Christoph Feck, TowerSystems
- \X/ Amiga - Intuition inside.
-